<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>添加工单</title>
</head>
<body>

	<div style="text-align: center;">
		<div style="font-size: 20px; text-align: center;">添加工单</div>
		<input id="id" style="display: none" value="0">
		<div style=" text-align: center;">执行人
		<input id="executor" >
		</div>
		
		<div style=" text-align: center;">任务描述:
		<textarea rows="10px" cols="20px" id="description"></textarea>
		</div>
		
		<div style=" text-align: center;">级别:
			<select id="level">
				<option value="1">级别1</option>
				<option value="2">级别2</option>
				<option value="3">级别3</option>
			</select>
		</div>
		
		<button onclick="submit()">提交</button>
		
	</div>
</body>

<script type="text/javascript" src="http://libs.baidu.com/jquery/2.1.4/jquery.min.js"></script>
<script type="text/javascript">

	function submit() {
		var id=$("#id").val();
		var executor=$("#executor").val();
		var description=$("#description").val();
		var  level=$("#level").val();

		$.ajax({
			url:"/homework/workOrder/savaWorkOrder",
			type:"post",
			data:{"id":id,"executor":executor,"description":description,"level":level},
			dataType:"json",
			success:function(data){
				if(data.code==1){
					location.href="/homework/workOrder/toList"
				}else
					alert(data.message)
			}

		})
	}
</script>
</html>